package com.huluobo.a2302mdmdemo.demo

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.navigation.NavHostController
import com.blankj.utilcode.util.SPUtils
import com.google.gson.Gson

/**
 *  Created by LC on 2025/7/21.
 */

data class User(val username: String, val password: String, val img: String)

@Composable
fun FirstPage(navHostController: NavHostController) {
    val user = User("lc", "123", "http://www.baidu.com")
    val json = Gson().toJson(user)
    Text(text = "第一页面", modifier = Modifier
        .fillMaxSize()
        .background(Color.Yellow)
        .clickable {
            SPUtils
                .getInstance()
                .put("user", json)
            navHostController.navigate("sec")
        })
}